From: Matthieu Gallien Date: Fri, 21 Feb 2025 12:47:00 +0000 (+0100) Subject: ensure we can delete invalid read-only items X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~2^2~37^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=dcd2c4bddfb5682ef0206aed02d5ae3086a25615;p=nextcloud-desktop.git ensure we can delete invalid read-only items Signed-off-by: Matthieu Gallien --- diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 85e004995..cc5a0f74a 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -1736,7 +1736,16 @@ void Folder::slotNeedToRemoveRemnantsReadOnlyFolders(const QList_file); +#if !defined(Q_OS_MACOS) || __MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_15 + const auto fileInfo = QFileInfo{localPath + oneFolder->_file}; + const auto parentFolderPath = fileInfo.dir().absolutePath(); + const auto parentPermissionsHandler = FileSystem::FilePermissionsRestore{parentFolderPath, FileSystem::FolderPermissions::ReadWrite}; +#endif + if (oneFolder->_type == ItemType::ItemTypeDirectory) { + FileSystem::removeRecursively(localPath + oneFolder->_file); + } else { + FileSystem::remove(localPath + oneFolder->_file); + } } callback(true); setSyncPaused(false);